<?php
	//使用GD库画图
	//需要一个画布
	//$huabu = imagecreate(400,400);
	//创建一个真色彩画布
	$huabu = imagecreatetruecolor(350,250);
	//需要一支笔
	//需要颜色
	$red = imagecolorallocate($huabu,255,0,0);
	$white = imagecolorallocate($huabu,255,255,255);
	$pink = imagecolorallocate($huabu,249,183,245);
	$bulue = imagecolorallocate($huabu,0,255,0);
	$yellow = imagecolorallocate($huabu,249,253,87);
	//画布也需要颜色
	//填充画布
	imagefill($huabu,50,50,$white);
	//输出图像
	//画一个像素点
	// imagesetpixel($huabu,50,50,$red);
	// for($i = 50; $i <=100; $i ++ )
	// {
		// imagesetpixel($huabu,50,$i,$red);
	// }
	//画一个线
	// imageline($huabu,30,30,190,190,$red);
	// imageline($huabu,1,1,190,190,$red);
	//画矩形
	// imagerectangle($huabu,40,40,160,160,$pink);
	//画一个矩形并填充
	// imagefilledrectangle($huabu,40,40,160,160,$pink);
	//画多边形
	$arr = array(78,11,62,49,10,51,50,73,37,115,77,93,119,117,106,76,147,49,92,52);
	imagepolygon($huabu,$arr,10,$red);
	imagefilledpolygon($huabu,$arr,10,$yellow);
	imagefill($huabu,1,1,$red);
	header("content-type:image/png");
	imagepng($huabu);
	imagedestroy($huabu);